<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>

<html>
<head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
    <link href="bootstrap-3.3.7/css/bootstrap.css" rel="stylesheet"
          type="text/css"/>
    <script type="text/javascript" src="bootstrap-3.3.7/js/jquery.js"></script>
    <script type="text/javascript" src="bootstrap-3.3.7/js/bootstrap.min.js"></script>

  <script>

        function fenye(cpage) {
            $("[name='cpage']").val(cpage)
            $("form").submit();
        }

        function delAll() {
            var ids = "";
            $(".ck:checked").each(function () {
                ids += ","+$(this).val();
            })
            if(ids){
                ids = ids.substring(1);
                alert(ids)
            }
            location.href="delAll?ids="+ids;
        }

    </script>



</head>
<body>
<div class="container">
    <div class="row">
        <form action="/list" method="post">

            <input type="hidden" name="cpage" value="1">
            名称：<input type="text" name="keyword" value="${keyword}">
            <input type="submit" value="搜索">
        </form>
        <table class="table table-hover table-bordered">
            <tr>
                <td>选择</td>
                <td>编号</td>
                <td>姓名</td>
                <td>性别</td>
            </tr>

            <c:forEach var="s" items="${slist}">
                <tr>
                    <td>
                        <input type="checkbox" class="ck" name="ck" value="${s.id}">
                    </td>
                    <td>${s.id}</td>
                    <td>${s.name}</td>
                    <td>${s.sex}</td>
                </tr>
            </c:forEach>
            <tr>
                <td colspan="15">
                    <input type="button" value="批删" onclick="delAll()">
                    ${p.pageUrl}
                </td>
            </tr>
        </table>
    </div>
</body>
</html>